#ifndef GAMEENGINE_GEOMETRY_COLUMN_H
#define GAMEENGINE_GEOMETRY_COLUMN_H

#include <GameEngine/Geometry/geometry_settings.h>

#include <GameEngine/Geometry/Location/point3d.h>
#include <GameEngine/Geometry/Location/vector3d.h>
#include <GameEngine/Geometry/Lines/line3d.h>
#include <GameEngine/Geometry/Core/interval.h>


#ifdef GAMEENGINE_NAMESPACES
namespace GameEngine {
#endif

//! Class used to represent 3D columns
/*!
 @note A column is a volumetric object represented by a base surface, which is extruded
       along the vector direction with extrusion length specified by the given interval
 @note Most algorithms expect floating point operations. Type T should therefore
       not be an integer type
 @todo Setup unit tests
 */
template <class S, class T>
class Column {

public:
	Column();
	Column(const S& base, const Vector<T>& extrusion_vector, const Interval<T>& interval);
	Column(const Column& rhs);
	virtual ~Column();
	Column& operator=(const Column& rhs);

	S& base();
	const S& base() const;
	Vector<T>& extrusion_vector();
	const Vector<T>& extrusion_vector() const;
	Interval<T>& interval();
	const Interval<T>& interval() const;

	T area() const;
	T volume() const;

	bool inside(const Point3d<T>& rhs, bool strict = false) const;
// TODO	int intersection(const Line3d<T>& rhs, T& coordinate1, T& coordinate2, IntersectionType::Type* type = nil) const;

	bool degenerate(const T& tolerance = 0.000001) const;

protected:
	//! The base of the column
	S base_;

	//! The extrusion vector of the column
	Vector<T> extrusion_vector_;

	//! The extrusion interval of the column
	Interval<T> interval_;
};

#ifdef GAMEENGINE_NAMESPACES
} // namespace GameEngine
#endif

#include <GameEngine/Geometry/Volumes/column.hpp>

#endif
